﻿<UserControl x:Class="AMPLibrary.Controls.AutomaticPlaylistDetailsControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    
    <UserControl.Foreground>White</UserControl.Foreground>
    <UserControl.Background>Transparent</UserControl.Background>
    <UserControl.Resources>
        <DataTemplate x:Key="nowPlayingAudioDataTemplate">
            <StackPanel Background="Transparent" Height="30" Margin="0,1,0,1">
                <TextBlock Text="{Binding Path=Tag.Title}" Foreground="White" Background="Transparent" VerticalAlignment="Top" TextTrimming="WordEllipsis" />
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=Tag.AlbumArtist}" Foreground="#aa787d" Padding="0 0 10 0" />
                    <TextBlock Text="-  " Foreground="White" Background="Transparent" />
                    <TextBlock Text="{Binding Path=Tag.Album}" Foreground="#77787d" Padding="0 0 10 0" />
                    <TextBlock Text="-  " Foreground="White" Background="Transparent" Padding="0 0 10 0" />
                    <TextBlock Grid.Column="1" Foreground="White" Background="Transparent" VerticalAlignment="Top">
                        <TextBlock.Text>
                            <MultiBinding StringFormat="{}{0:00}:{1:00}:{2:00}">
                                <Binding Path="Duration.Hours" />
                                <Binding Path="Duration.Minutes" />
                                <Binding Path="Duration.Seconds" />
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <Grid Name="mainGrid" Background="Transparent" Margin="6,0,6,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="28" />
            <RowDefinition Height="200" />
            <RowDefinition Height="60" />
            <RowDefinition Height="60" />
            <RowDefinition Height="60" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="175" MaxWidth="175" />
            <ColumnDefinition Width="175" MaxWidth="175" />
            <ColumnDefinition MinWidth="200" />
        </Grid.ColumnDefinitions>
        
        <Label Name="automaticPlaylistNameLabel" Grid.ColumnSpan="3" FontSize="16" Foreground="White" />

        <Grid Grid.Row="1" Grid.Column="3" Grid.RowSpan="4" Margin="6,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="28" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            
            <Label Foreground="White">Current generated list:</Label>

            <ListBox Name="currentSelectedPlaylistListBox" Grid.Row="1" SelectionMode="Extended" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ItemTemplate="{StaticResource nowPlayingAudioDataTemplate}" Background="Transparent">

            </ListBox>
        </Grid>

        <Grid Grid.Row="1" Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="28"  />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Label Foreground="White">Filter by genre (multiple select):</Label>
            
            <ListBox Name="genreListBox" Grid.Row="1" SelectionMode="Extended" SelectionChanged="genreListBox_SelectionChanged" ScrollViewer.HorizontalScrollBarVisibility="Hidden">

            </ListBox>
        </Grid>

        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="28"  />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Label Foreground="White">Filter by year (multiple select):</Label>

            <ListBox Name="yearListBox" Grid.Row="1" SelectionMode="Extended" SelectionChanged="yearListBox_SelectionChanged" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Margin="6,0,0,0">

            </ListBox>
        </Grid>

        <StackPanel Grid.Row="2" Orientation="Vertical">
            <Label Foreground="White">User media rating:</Label>
            <ComboBox Name="userMediaRating" SelectionChanged="userMediaRating_SelectionChanged">
                <ComboBoxItem Content="No consideration" IsSelected="True" />
                <ComboBoxItem Content="Unrated" />
                <ComboBoxItem Content="One Star" />
                <ComboBoxItem Content="Two Stars" />
                <ComboBoxItem Content="Three Stars" />
                <ComboBoxItem Content="Four Stars" />
                <ComboBoxItem Content="Five Stars" />
                <ComboBoxItem Content="At least one star" />
                <ComboBoxItem Content="At least two stars" />
                <ComboBoxItem Content="At least three stars" />
                <ComboBoxItem Content="At least four stars" />
                <ComboBoxItem Content="At least 5 stars" />
            </ComboBox>
        </StackPanel>

        <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Vertical" Margin="6,0,0,0">
            <Label Foreground="White">Favorites consideration:</Label>
            <ComboBox Name="favoritesConsiderationComboBox" SelectionChanged="favoritesConsiderationComboBox_SelectionChanged">
                <ComboBoxItem Content="Use all music" IsSelected="True" />
                <ComboBoxItem Content="Use only favorites" />
                <ComboBoxItem Content="Use all music but ignore your favorites" />
            </ComboBox>
        </StackPanel>
        
        <StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical">
            <Label Foreground="White">Played Frequency consideration:</Label>
            <ComboBox Name="frequencyConsiderationComboBox" SelectionChanged="frequencyConsiderationComboBox_SelectionChanged" >
                <ComboBoxItem Content="No consideration" IsSelected="True" />
                <ComboBoxItem Content="Never played before" />
                <ComboBoxItem Content="Consider only the last 250 songs played" />
                <ComboBoxItem Content="Consider only the last 500 songs played" />
                <ComboBoxItem Content="Consider only the last 750 songs played" />
            </ComboBox>
        </StackPanel>

        <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Vertical" Margin="6,0,0,0">
            <Label Foreground="White">Recently added media:</Label>
            <ComboBox Name="recentlyAddedConsiderationComboBox" SelectionChanged="recentlyAddedConsiderationComboBox_SelectionChanged">
                <ComboBoxItem Content="No consideration" IsSelected="True" />
                <ComboBoxItem Content="In the last week" />
                <ComboBoxItem Content="In the last two weeks" />
                <ComboBoxItem Content="In the last month" />
                <ComboBoxItem Content="In the last three months" />
                <ComboBoxItem Content="In the last six months" />
                <ComboBoxItem Content="In the last year" />
            </ComboBox>
        </StackPanel>

        <StackPanel Grid.Row="4" Orientation="Vertical">
            <Label Foreground="White">Playlist item limit:</Label>
            <TextBox Name="itemLimitTextBox" PreviewTextInput="itemLimitTextBox_PreviewTextInput" Width="50" HorizontalAlignment="Left" />
        </StackPanel>

        <StackPanel Grid.Row="5" Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Name="genereatePlaylistButton" Click="genereatePlaylistButton_Click" Height="28" Width="100" Margin="6,6,0,0">Generate Playlist</Button>
            <Button Name="listenNowButton" Click="listenNowButton_Click" Height="28" Width="100" Margin="6,6,0,0">Listen now</Button>
        </StackPanel>

        <TextBlock Grid.Row="6" Grid.ColumnSpan="3" Foreground="White" VerticalAlignment="Bottom" TextWrapping="Wrap">
            * Note: you can use this screen to automatically create custom playlists to meet your music needs. Set your criteria and click 'Generate Playlist'.
        </TextBlock>
    </Grid>
</UserControl>
